home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / os2 / splot170.zip / demo / 3DDRAW.SPT < prev    next >
Text File  |  1996-10-10  |  5KB  |  204 lines

  1. #include <splot.h>
  2.  
  3. double* data;
  4. int i;
  5.  
  6. int colour_fill(int colour)
  7. {
  8.  gsave();
  9.  set(LINECOLOUR,colour);
  10.  fill();
  11.  grestore();
  12. };
  13.  
  14. main()
  15. {
  16.  set(FONTWIDTH,0.3);
  17.  text(0.5,25.5,CURFILENAME);
  18.  set(FONTWIDTH,0.5);
  19.  set(AXESCLIP,ON);
  20.  set(PAGEROT,OFF);
  21.  scale(.9,.9);
  22.  
  23.  // perspective guide
  24.  set(LINEWIDTH,0.001);
  25.  set(LINECOLOUR,CYAN);
  26.  for(i=-10;i<30;i++)
  27.  {
  28.   moveto(-30,25);
  29.   lineto(25,i);
  30.   stroke();
  31.   moveto(50,30);
  32.   lineto(0,i);
  33.   stroke();
  34.  }
  35.  moveto(-30,25);
  36.  lineto(18,6.5);
  37.  stroke();
  38.  
  39.  set(LINECOLOUR,BLACK);
  40.  set(LINEWIDTH,0.05);
  41.  moveto( 10.95,2.67);
  42.  lineto( 5.137,5.820 , 5.137,9.03, 10.95,
  43. 6.39);
  44.  closepath();
  45.  colour_fill(GREEN);
  46.  stroke();
  47.  
  48.  moveto( 5.137,9.03);
  49.  lineto( 10.751,11.659, 16.52,9.78, 10.95,6.39);
  50.  colour_fill(WHITE);
  51.  closepath();
  52.  stroke();
  53.  
  54.  moveto( 10.95,6.39);
  55.  lineto( 10.95,2.69, 16.52,6.51, 16.52,9.78);
  56.  colour_fill(WHITE);
  57.  closepath();
  58.  
  59.  moveto( 15.948,6.883);
  60.  lineto( 14.798,6.118, 14.798,8.152, 15.948,8.861);
  61.  closepath();
  62.  colour_fill(WHITE);
  63.  stroke();
  64.  
  65.  moveto( 9.61,8.42);
  66.  lineto( 12.85,10.19, 13.32,11.20, 13.326,18.285, 8.76,16.81, 8.76,10.07);
  67.  closepath();
  68.  colour_fill(WHITE);
  69.  stroke();
  70.  
  71.  
  72.  moveto( 9.61,8.42);
  73.  lineto( 7.042,9.527, 6.492,10.954, 8.76,10.072);
  74.  closepath();
  75.  colour_fill(BLACK);
  76.  stroke();
  77.  
  78.  moveto( 8.76,10.072);
  79.  lineto( 8.76,16.819, 6.492,17.312, 6.492,10.954);
  80.  closepath();
  81.  colour_fill(GREEN);
  82.  stroke();
  83.  
  84.  moveto( 6.491,17.316);
  85.  lineto( 10.978,18.66 , 13.314,18.285, 8.76,16.823);
  86.  closepath();
  87.  colour_fill(WHITE);
  88.  stroke();
  89.  
  90.  moveto( 8.677,17.962);
  91.  lineto( 11.030,17.554, 11.03,12.854, 8.737,11.855, 6.491,12.648);
  92.  stroke();
  93.  
  94.  
  95.  //input port
  96.  moveto( 15.362+.189,8.255-0.052);
  97.  rsplineto( -0.189,0.052,-0.177,-0.069, -0.148,-0.155, -0.16,-0.286, -0.041,-0.29, 0.070,-0.310, 0.130,-0.208);
  98.  lineto( 17.134,6.105, 17.368,7.531);
  99.  closepath();
  100.  colour_fill(GREEN);
  101.  stroke();
  102.  moveto( 17.283+.189,7.526-.052);
  103.  rsplineto(- 0.189,0.052,-0.177,-0.069, -0.148,-0.155, -0.16,-0.286, -0.041,-0.29, 0.070,-0.310, 0.130,-0.208, 0.313,-0.118, 0.280,0.114, 0.198,0.274, 0.049,0.294, -0.020,0.331, -0.148,0.257, -0.161,0.114); closepath();
  104.  colour_fill(WHITE);
  105.  stroke();
  106.  
  107.  // LN2 tank
  108.  // contour
  109.  moveto( 11.803,18.179);
  110.  lineto( 11.803,19.058, 13.444,19.671, 13.775,19.874, 13.799,19.929, 13.815,24.721, 12.294,25.168, 10.310,25.160, 8.804,24.713, 8.797,19.929, 8.837,19.866, 9.070,19.690, 10.802,19.058, 10.794,18.179);
  111.  splineto( 10.8249,18.1363, 10.8727,18.1029, 10.9402,18.0779, 11.0048,18.0639, 11.0694,18.05 ,11.1594,18.0389, 11.2296,18.0333, 11.3785,18.0361, 11.4629,18.0417, 11.5415,18.0528, 11.6118,18.0667, 11.6792,18.0862, 11.7242,18.1029,
  112.  11.7607,18.128 ,11.786,18.1558);
  113.  closepath();
  114.  colour_fill(CYAN);
  115.  stroke();
  116.  
  117.  gsave();
  118.  scale(1,.25);
  119.  arc( 11.306,76.22,.5,180,360);
  120.  stroke();
  121.  grestore();
  122.  
  123.  gsave();
  124.  scale(1,.2);
  125.  arc( 11.306,99.65,2.5,180,360);
  126.  stroke();
  127.  grestore();
  128.  
  129.  gsave();
  130.  scale(1,.05);
  131.  arc( 11.306,494.30,2.5,180,360);
  132.  stroke();
  133.  arc( 11.306,503.22,1,0,360);
  134.  colour_fill(WHITE);
  135.  stroke();
  136.  grestore();
  137.  
  138.  // scan tube
  139.  gsave();
  140.  scale(1,0.3);
  141.  arc( 8.859,58.140,1.2,180,0);
  142.  closepath();
  143.  colour_fill(BLACK);
  144.  grestore();
  145.  moveto( 7.668,17.46);
  146.  lineto( 7.668,25.02, 10.050,25.124, 10.050,17.459);
  147.  closepath();
  148.  colour_fill(BLACK);
  149.  stroke();
  150.  
  151.  // motor box
  152.  moveto( 7.085,25.022);
  153.  lineto( 9.218,25.022, 9.218,26.711, 7.085,26.64);
  154.  closepath();
  155.  colour_fill(GREEN);
  156.  stroke();
  157.  
  158.  moveto( 9.218,25.022);
  159.  lineto( 10.245,25.116, 10.245,26.753, 9.218,26.72);
  160.  closepath();
  161.  stroke();
  162.  
  163.  // motor circles
  164.  gsave();
  165.  scale(.8,1);
  166.  arc( 12.346,25.905,1,90,270);
  167.  lineto( 12.734,24.885, 12.752,26.921);
  168.  closepath();
  169.  colour_fill(GREEN);
  170.  stroke();
  171.  arc( 12.762,25.905,1,0,360);
  172.  closepath();
  173.  colour_fill(WHITE);
  174.  stroke();
  175.  grestore();
  176.  
  177.  // labels
  178.  
  179.  text( 14.62,23.62,"external liquid");
  180.  text("nitrogen reservoir");
  181.  text( 3.62,26 ,"scan motor");
  182.  text( 16.25,5.5 ,"input port");
  183.  text( 3.5,18.5 ,"scanning mirror");
  184.  text("assembly");
  185.  text( 14.37,16.75,"interferometer");
  186.  text("box");
  187.  text( 14.62,12 ,"collimator");
  188.  text("    box");
  189.  moveto( 15.25,11.37);
  190.  lineto( 14.62,10.12);
  191.  moveto( 14.25,15.75);
  192.  lineto( 12.75,15.25);
  193.  moveto( 14.37,23.12);
  194.  lineto( 13.37,23 );
  195.  moveto( 6.5,25.87);
  196.  lineto( 7.5,25.87);
  197.  moveto( 5.62,19 );
  198.  lineto( 7.37,20.12);
  199.  moveto( 4.5,17 );
  200.  lineto( 6.25,15.25);
  201.  stroke();
  202. }
  203.  
  204.